import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 图片放大的
import 'viewerjs/dist/viewer.css'
import VueViewer from 'v-viewer'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 文中代码块
import hljs from 'highlight.js';
import 'highlight.js/styles/atom-one-dark.css' //样式
import vuetyped from 'vue3typed'

// 评论功能
import UndrawUi from 'undraw-ui'
import 'undraw-ui/dist/style.css'


const app = createApp(App)
app.use(UndrawUi)

//创建v-highlight全局指令
app.directive('highlight',function (el) {
  let blocks = el.querySelectorAll('pre code');
  blocks.forEach((block)=>{
    hljs.highlightBlock(block)
  })
})
// 全局注册el-icon
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// 注册图片放大
app.use(VueViewer)
app.use(vuetyped).use(store).use(router).mount('#app')